//-----------------------------------------------------------------------
// <copyright file="tblConstantService.cs" company="Cyvee">
//     Copyright ? Cyvee. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using Scb.Framework;
using Robot.Entities;
using Robot.Data;
    
namespace Robot.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class tblConstantService
    {
      #region My Store procedure

      public static tblConstantCollection GettblConstantListByParaName(string sParaName)
      {
        try
        {
          tblConstantDAO tblConstantDAO = new tblConstantDAO();
          return tblConstantDAO.GettblConstantListByParaName(sParaName);
        }
        catch (BusinessException)
        {
          throw;
        }
        catch (Exception ex)
        {
          // log this exception
          Logger.Error(ex);
          // wrap it and rethrow
          throw new BusinessException(SR.BusinessGettblConstantListException, ex);
        }
      }
     
#endregion

      #region tblConstant

      public static void CreatetblConstant(tblConstant tblConstant)
        {            
            try
            {
                tblConstantDAO tblConstantDAO = new tblConstantDAO();
                tblConstantDAO.CreatetblConstant(tblConstant);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreatetblConstantException, ex);
            }
        }        

        public static void UpdatetblConstant(tblConstant tblConstant)
        {            
            try
            {
                tblConstantDAO tblConstantDAO = new tblConstantDAO();
                tblConstantDAO.UpdatetblConstant(tblConstant);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdatetblConstantException, ex);
            }
        }        

        public static void DeletetblConstant(int id)
        {            
            try
            {
                tblConstantDAO tblConstantDAO = new tblConstantDAO();
                tblConstantDAO.DeletetblConstant(id);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeletetblConstantException, ex);
            }
        }
        
        public static tblConstant GettblConstant(int id)
        {            
            try
            {
                tblConstantDAO tblConstantDAO = new tblConstantDAO();
                return tblConstantDAO.GettblConstant(id);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblConstantException, ex);
            }
        }                

        public static tblConstantCollection GettblConstantList(tblConstantColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                tblConstantDAO tblConstantDAO = new tblConstantDAO();
                return tblConstantDAO.GettblConstantList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblConstantListException, ex);
            }
        }        

        public static tblConstantCollection GettblConstantList(tblConstantColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                tblConstantDAO tblConstantDAO = new tblConstantDAO();
                return tblConstantDAO.GettblConstantList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblConstantListException, ex);
            }
        }        

        #endregion
    }
}